package com.sunny.excel.config;

import com.sunny.excel.util.StringUtils;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Getter
@Component
public class Env {

    private String tempDir;

    @Value("${temp.dir:null}")
    public void setTempDir(String tempDir) {
        if (StringUtils.isBlank(tempDir) || StringUtils.equalsIgnoreCase(tempDir, "null")) {
            this.tempDir = System.getProperty("java.io.tmpdir");
        } else {
            this.tempDir = tempDir;
        }
    }


}
